This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 6, 2017, 3:38 AM
2 Posts
topic has been resolvedResolved

Xpages profile lookup

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: Xpages,IBM Notes,Javascript
  • Replies: 3

Hi, 

  I need help in setting data source in Xpages using lookup from profile document. 

  The profile document has server and dbpath in separate fields.

  As of now, i'm successful in getting them in individual fields and using 'session variable' from profile documents, If that helps

But need help in forming datasource to be used further in the database. 

Thanks  for all your assistance. 

 

Regards, 

Harris. 

 

 

Mar 6, 2017, 6:02 PM
586 Posts
hmm

I'm not sure I'm totally understanding the question.  First I would say that if possible avoid using profile documents in XPages.  Just use normal documents if that's on option.  Profile documents are cached by the server and I believe you'll have inconsistent requests in retrieving values after updates.

 

Not sure what you're looking for regards to DataSource.  For xpages you should read in the values you want from the doc and then put them into ApplicationScope.  You can't hold onto a NotesDocument itself in memory for long term.  And this presents the next problem with profile documents.  You're now caching them twice really.

If there's no need for a client app piece I suggest you switch to using a normal document.  Have an xpage to update the values.  On save you update application scope variables.  You would then need a small code block to simple load those values if they don't already exist on your web pages.  Probably not explained great but that I believe is the best practice here.

 

Good Luck

Dave

NotesIn9.com

Mar 7, 2017, 3:18 AM
2 Posts
Thanks Dave

Hi Dave,

I was able to perform that by using lookups at field level and

Although 'Application scope' variable is the best advised, 

I think session scope would satisfy my requirement.

Hope that works well.

Thanks for your advise. Much appreciated.  

Regards,

Harris.

Mar 8, 2017, 1:05 PM
586 Posts
.

glad you got it working.

 

If the values are for all users in the database then you'd typically want to use applicationScope.  If the values are user specific then year sessionScope is what you want to use.  Just remember that sessionScope is really more like "browserScope".  Meaning if you set a sessionScope variable and a user logs out and a different user logs back in right away values from the 1st user might survive if you don't clear and/or overwrite them yourself.

 

Dave


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal